package educrypt.tests;

import educrypt.exceptions.EduCryptException;

import educrypt.io.Input;

@SuppressWarnings("unused")
public class TesterIO {

	private final static String testDirectoryPath = "testCharEncoding/";
	private final static String testFileANSI = "Character Encoding ANSI.txt";
	private final static String testFileUTF8 = "Character Encoding UTF-8.txt";
	private final static String testFileUS2CLE = "Character Encoding USC2-LE.txt";
	private final static String testFileUSC2BE = "Character Encoding USC2-BE.txt";

	private static void testCharacterEncoding() throws EduCryptException {
		String textFromANSI = " ";
		String textFromUTF8 = " ";
		String textFromUSC2LE = " ";
		String textFromUSC2BE = " ";

		textFromANSI = Input.readTextFromFile(testDirectoryPath + testFileANSI);
		textFromUTF8 = Input.readTextFromFile(testDirectoryPath + testFileUTF8);
		textFromUSC2LE = Input.readTextFromFile(testDirectoryPath
				+ testFileUS2CLE);
		textFromUSC2BE = Input.readTextFromFile(testDirectoryPath
				+ testFileUSC2BE);

		System.out.println(textFromANSI);
		System.out.println("\n::::::::::::::::::::::::::\n");
		System.out.println(textFromUTF8);
		System.out.println("\n::::::::::::::::::::::::::\n");
		System.out.println(textFromUSC2LE);
		System.out.println("\n::::::::::::::::::::::::::\n");
		System.out.println(textFromUSC2BE);
	}

	private static void testInputTXT() throws EduCryptException {
		String inputDataANSI = Input.readTextFile("testIO/testTXTANSI.txt");
		educrypt.io.Output.writePlainText(inputDataANSI,
				"testIO/testTXTANSIOutput.txt");
		String inputDataUTF8 = Input.readTextFile("testIO/testTXTUTF8.txt");
		System.out.println(inputDataUTF8);
	}

	private static void testInputPDF() throws EduCryptException {
		String inputData = Input.readPdfFile("testIO/testPDF.pdf");
		System.out.println(inputData);
	}

	private static void testInputDoc() throws EduCryptException {
		String inputData = Input.readAnyDocFile("testIO/testDOC.doc");
		System.out.println(inputData);
	}

	private static void testInputDocX() throws EduCryptException {
		String inputData = Input.readAnyDocFile("testIO/testDOCX.docx");
		System.out.println(inputData);

	}

	public static void main(String[] args) throws EduCryptException {
		// testCharacterEncoding();
		// testInputTXT();
		// testInputDoc();
		testInputDocX();
		// testInputPDF();

	}
}
